﻿using TMPro;
using UnityEngine;

public class QuestCardNPC : QuestCard
{
    [SerializeField] private TextMeshProUGUI questRewardTMP;

    public override void ConfigQuestUI(Quest quest)
    {
        base.ConfigQuestUI(quest);
        questRewardTMP.text = $"- {quest.GoldReward}金币\n" +
                              $"- {quest.ExpReward}经验值\n" +
                              $"- x {quest.ItemReward.Quantity}{quest.ItemReward.Item.Name}";
    }

    public void AcceptQuest()
    {
        if (QuestToComplete == null)
        {
            return;
        }

        QuestToComplete.QuestAccepted = true;
        QuestManager.instance.AcceptQuest(QuestToComplete);
        gameObject.SetActive(false);
    }
}